hvm/vpmu: Prevent dump handlers from incorrectly mutating state
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 16 Sep 2013 10:22:20 +0000 (12:22 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 16 Sep 2013 10:22:20 +0000 (12:22 +0200)
commit42c5b1214071d363a52c6356dfe2ed820f500849
tree448f02feb3bc20cbc825ccefc4fda5ac0a407660
parent593470233ff38385df9dcf5690cc58c7a4fb290d
hvm/vpmu: Prevent dump handlers from incorrectly mutating state

Discovered by Coverity, CID 1055181

core2_vpmu_dump() was incorrectly setting VPMU_CONTEXT_LOADED when it
was intending to check for it.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
This would have been avoided if the dump function declared all its
pointers "const" - doing this now (also in SVM).

Also fixing some indentation issues at once.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
xen/arch/x86/hvm/svm/vpmu.c
xen/arch/x86/hvm/vmx/vpmu_core2.c
xen/include/asm-x86/hvm/vpmu.h